
class Product {
  final int id;
  final String createTime;
  final String orderState;
  final String image;
  final String name;
  final int totalNum;
  final double curPrice;
  final String attrsText;

  Product({
    required this.id,
    required this.createTime,
    required this.orderState,
    required this.image,
    required this.name,
    required this.totalNum,
    required this.curPrice,
    required this.attrsText,
  });

  Product copyWith({
    int? id,
    String? createTime,
    String? orderState,
    String? image,
    String? name,
    int? totalNum,
    double? curPrice,
    String? attrsText,
  }) {
    return Product(
      id: id ?? this.id,
      createTime: createTime ?? this.createTime,
      orderState: orderState ?? this.orderState,
      image: image ?? this.image,
      name: name ?? this.name,
      totalNum: totalNum ?? this.totalNum,
      curPrice: curPrice ?? this.curPrice,
      attrsText: attrsText ?? this.attrsText,
    );
  }
}